<template>
	<view class="flex align-center justify-between mx-3 my-4">
		<block v-for="(item, index) in functionSortArr" :key="index">
			<view class="flex flex-column align-center" @tap="switchToPage(index)">
				<my-icon :iconId="item.iconId" :iconColor="item.iconColor" iconSize="65" />
				<text>{{item.name}}</text>
			</view> 
		</block>
	</view> 
</template>

<script>
	const pageList=  {
		[0]: '/pages/readList/readList',
		[1]: '/pages/listenNoval/listenNoval',
		[2]: '/pages/listMusic/listMusic',
		[3]: '/pages/listenKnowledge/listenKnowledge',
	};
	export default {
		name:"functionSort",
		props:{
			functionSortArr:{
				type: Array,
				default: []
			} 
		},
		data() {
			return {
				
			};
		},
		methods:{
			// 分类跳转页面
			switchToPage(pageIndex){
				uni.navigateTo({
					url: pageList[pageIndex]
				})
				
			}
		}
	}
</script>

<style>

</style>
